﻿using System;
using System.Collections.Generic;
using System.Web.Http;
using Breeze.ContextProvider;
using FazaDemo.BL.DataAccess;
using FazaDemo.BL.InterfaceDomain;
using FazaDemo.Data;
using FazaDemo.BL.Services_;
using Breeze.ContextProvider;

namespace FazaDemo.WebApi.Api
{
    public class MenuItemController : ApiController
    {

        private readonly IRepository<TS_SYS_EC_MENU, Tuple<string, int>> _repository;

        private readonly IMenuSetter setter;

        public MenuItemController()
        {
            _repository =
               new EntityRepository<TS_SYS_EC_MENU, Tuple<string, int>>();
            setter = new MenuSetter();
            var res = new SaveResult();
        }

        // GET api/<controller>
        public IEnumerable<Menu_Item> Get()
        {
            var loadingItems = _repository.GetAll();
            return setter.SetMenu(loadingItems);
        }

        // GET api/<controller>/5
        public string Get(int id)
        {
            return "value";
        }

        // POST api/<controller>
        public void Post([FromBody]string value)
        {
        }

        // PUT api/<controller>/5
        public void Put(int id, [FromBody]string value)
        {
        }

        // DELETE api/<controller>/5
        public void Delete(int id)
        {
        }
    }
}